{
  "cells": [
    {
      "cell_type": "markdown",
      "source": [
        "# Feature Extraction"
      ],
      "metadata": {}
    },
    {
      "cell_type": "markdown",
      "source": [
        "Feature Extraction (Feature Engineering) is a transformation of raw data into features suitable for modeling. Feature extraction is used for all machine learning algorithms.\n",
        "\n",
        "Feature extraction used for texts, images, geospatial data, date and time, and Time Series.\n",
        "\n",
        "Feature extraction starts from an initial set of measured data and builds derived values (features) intended to be informative and non-redundant, facilitating the subsequent learning and generalization steps, and in some cases leading to better human interpretations. Feature extraction is a dimensionality reduction process, where an initial set of raw variables is reduced to more manageable groups (features) for processing, while still accurately and completely describing the original data set. (Wikipedia)\n",
        "\nFeature engineering is the process of using domain knowledge of the data to create features that make machine learning algorithms work. Feature engineering is fundamental to the application of machine learning, and is both difficult and expensive. (Wikipedia)"
      ],
      "metadata": {}
    },
    {
      "cell_type": "code",
      "source": [
        "import numpy as np\n",
        "import matplotlib.pyplot as plt\n",
        "import pandas as pd\n",
        "\n",
        "import warnings\n",
        "warnings.filterwarnings(\"ignore\")\n",
        "\n",
        "# fix_yahoo_finance is used to fetch data \n",
        "import fix_yahoo_finance as yf\n",
        "yf.pdr_override()"
      ],
      "outputs": [],
      "execution_count": 1,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# input\n",
        "symbol = 'AMD'\n",
        "start = '2014-01-01'\n",
        "end = '2018-08-27'\n",
        "\n",
        "# Read data \n",
        "dataset = yf.download(symbol,start,end)"
      ],
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "[*********************100%***********************]  1 of 1 downloaded\n"
          ]
        }
      ],
      "execution_count": 39,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "dataset.head()"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 40,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Open</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Volume</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>Date</th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>2014-01-02</th>\n",
              "      <td>3.85</td>\n",
              "      <td>3.98</td>\n",
              "      <td>3.84</td>\n",
              "      <td>3.95</td>\n",
              "      <td>3.95</td>\n",
              "      <td>20548400</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-03</th>\n",
              "      <td>3.98</td>\n",
              "      <td>4.00</td>\n",
              "      <td>3.88</td>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>22887200</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-06</th>\n",
              "      <td>4.01</td>\n",
              "      <td>4.18</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.13</td>\n",
              "      <td>4.13</td>\n",
              "      <td>42398300</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-07</th>\n",
              "      <td>4.19</td>\n",
              "      <td>4.25</td>\n",
              "      <td>4.11</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>42932100</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-08</th>\n",
              "      <td>4.23</td>\n",
              "      <td>4.26</td>\n",
              "      <td>4.14</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>30678700</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "            Open  High   Low  Close  Adj Close    Volume\n",
              "Date                                                    \n",
              "2014-01-02  3.85  3.98  3.84   3.95       3.95  20548400\n",
              "2014-01-03  3.98  4.00  3.88   4.00       4.00  22887200\n",
              "2014-01-06  4.01  4.18  3.99   4.13       4.13  42398300\n",
              "2014-01-07  4.19  4.25  4.11   4.18       4.18  42932100\n",
              "2014-01-08  4.23  4.26  4.14   4.18       4.18  30678700"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 40,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "Create new features with Original data"
      ],
      "metadata": {}
    },
    {
      "cell_type": "code",
      "source": [
        "# Add more data\n",
        "dataset['Increase_Decrease'] = np.where(dataset['Volume'].shift(-1) > dataset['Volume'],'Increase','Decrease')\n",
        "dataset['Buy_Sell_on_Open'] = np.where(dataset['Open'].shift(-1) > dataset['Open'],1,0)\n",
        "dataset['Buy_Sell'] = np.where(dataset['Adj Close'].shift(-1) > dataset['Adj Close'],1,0)\n",
        "dataset['Returns'] = dataset['Adj Close'].pct_change()\n",
        "dataset['Average'] = dataset[['Open','High','Low','Adj Close']].mean(axis=1)\n",
        "dataset['Std'] = dataset[['Open','High','Low','Adj Close']].std(axis=1)\n",
        "dataset = dataset.dropna()\n",
        "dataset.head()"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 41,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Open</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Volume</th>\n",
              "      <th>Increase_Decrease</th>\n",
              "      <th>Buy_Sell_on_Open</th>\n",
              "      <th>Buy_Sell</th>\n",
              "      <th>Returns</th>\n",
              "      <th>Average</th>\n",
              "      <th>Std</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>Date</th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>2014-01-03</th>\n",
              "      <td>3.98</td>\n",
              "      <td>4.00</td>\n",
              "      <td>3.88</td>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>22887200</td>\n",
              "      <td>Increase</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.012658</td>\n",
              "      <td>3.9650</td>\n",
              "      <td>0.057446</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-06</th>\n",
              "      <td>4.01</td>\n",
              "      <td>4.18</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.13</td>\n",
              "      <td>4.13</td>\n",
              "      <td>42398300</td>\n",
              "      <td>Increase</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.032500</td>\n",
              "      <td>4.0775</td>\n",
              "      <td>0.092150</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-07</th>\n",
              "      <td>4.19</td>\n",
              "      <td>4.25</td>\n",
              "      <td>4.11</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>42932100</td>\n",
              "      <td>Decrease</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>0.012107</td>\n",
              "      <td>4.1825</td>\n",
              "      <td>0.057373</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-08</th>\n",
              "      <td>4.23</td>\n",
              "      <td>4.26</td>\n",
              "      <td>4.14</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>30678700</td>\n",
              "      <td>Decrease</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>0.000000</td>\n",
              "      <td>4.2025</td>\n",
              "      <td>0.053151</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-09</th>\n",
              "      <td>4.20</td>\n",
              "      <td>4.23</td>\n",
              "      <td>4.05</td>\n",
              "      <td>4.09</td>\n",
              "      <td>4.09</td>\n",
              "      <td>30667600</td>\n",
              "      <td>Decrease</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>-0.021531</td>\n",
              "      <td>4.1425</td>\n",
              "      <td>0.086168</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "            Open  High   Low  Close  Adj Close    Volume Increase_Decrease  \\\n",
              "Date                                                                         \n",
              "2014-01-03  3.98  4.00  3.88   4.00       4.00  22887200          Increase   \n",
              "2014-01-06  4.01  4.18  3.99   4.13       4.13  42398300          Increase   \n",
              "2014-01-07  4.19  4.25  4.11   4.18       4.18  42932100          Decrease   \n",
              "2014-01-08  4.23  4.26  4.14   4.18       4.18  30678700          Decrease   \n",
              "2014-01-09  4.20  4.23  4.05   4.09       4.09  30667600          Decrease   \n",
              "\n",
              "            Buy_Sell_on_Open  Buy_Sell   Returns  Average       Std  \n",
              "Date                                                                 \n",
              "2014-01-03                 1         1  0.012658   3.9650  0.057446  \n",
              "2014-01-06                 1         1  0.032500   4.0775  0.092150  \n",
              "2014-01-07                 1         0  0.012107   4.1825  0.057373  \n",
              "2014-01-08                 0         0  0.000000   4.2025  0.053151  \n",
              "2014-01-09                 0         1 -0.021531   4.1425  0.086168  "
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 41,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "dataset['Month'] = dataset.index.month \n",
        "dataset['Day'] = dataset.index.day \n",
        "dataset['Year'] = dataset.index.year"
      ],
      "outputs": [],
      "execution_count": 42,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "dataset['Norm_Price'] = (dataset['Adj Close'] - dataset['Average']) / dataset['Std'] "
      ],
      "outputs": [],
      "execution_count": 43,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "dataset['Date_Stamp'] = pd.to_datetime(dataset.index)"
      ],
      "outputs": [],
      "execution_count": 44,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "dataset.head()"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 45,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Open</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Volume</th>\n",
              "      <th>Increase_Decrease</th>\n",
              "      <th>Buy_Sell_on_Open</th>\n",
              "      <th>Buy_Sell</th>\n",
              "      <th>Returns</th>\n",
              "      <th>Average</th>\n",
              "      <th>Std</th>\n",
              "      <th>Month</th>\n",
              "      <th>Day</th>\n",
              "      <th>Year</th>\n",
              "      <th>Norm_Price</th>\n",
              "      <th>Date_Stamp</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>Date</th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>2014-01-03</th>\n",
              "      <td>3.98</td>\n",
              "      <td>4.00</td>\n",
              "      <td>3.88</td>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>22887200</td>\n",
              "      <td>Increase</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.012658</td>\n",
              "      <td>3.9650</td>\n",
              "      <td>0.057446</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>2014</td>\n",
              "      <td>0.609272</td>\n",
              "      <td>2014-01-03</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-06</th>\n",
              "      <td>4.01</td>\n",
              "      <td>4.18</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.13</td>\n",
              "      <td>4.13</td>\n",
              "      <td>42398300</td>\n",
              "      <td>Increase</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.032500</td>\n",
              "      <td>4.0775</td>\n",
              "      <td>0.092150</td>\n",
              "      <td>1</td>\n",
              "      <td>6</td>\n",
              "      <td>2014</td>\n",
              "      <td>0.569722</td>\n",
              "      <td>2014-01-06</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-07</th>\n",
              "      <td>4.19</td>\n",
              "      <td>4.25</td>\n",
              "      <td>4.11</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>42932100</td>\n",
              "      <td>Decrease</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>0.012107</td>\n",
              "      <td>4.1825</td>\n",
              "      <td>0.057373</td>\n",
              "      <td>1</td>\n",
              "      <td>7</td>\n",
              "      <td>2014</td>\n",
              "      <td>-0.043574</td>\n",
              "      <td>2014-01-07</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-08</th>\n",
              "      <td>4.23</td>\n",
              "      <td>4.26</td>\n",
              "      <td>4.14</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>30678700</td>\n",
              "      <td>Decrease</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>0.000000</td>\n",
              "      <td>4.2025</td>\n",
              "      <td>0.053151</td>\n",
              "      <td>1</td>\n",
              "      <td>8</td>\n",
              "      <td>2014</td>\n",
              "      <td>-0.423324</td>\n",
              "      <td>2014-01-08</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-09</th>\n",
              "      <td>4.20</td>\n",
              "      <td>4.23</td>\n",
              "      <td>4.05</td>\n",
              "      <td>4.09</td>\n",
              "      <td>4.09</td>\n",
              "      <td>30667600</td>\n",
              "      <td>Decrease</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>-0.021531</td>\n",
              "      <td>4.1425</td>\n",
              "      <td>0.086168</td>\n",
              "      <td>1</td>\n",
              "      <td>9</td>\n",
              "      <td>2014</td>\n",
              "      <td>-0.609272</td>\n",
              "      <td>2014-01-09</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "            Open  High   Low  Close  Adj Close    Volume Increase_Decrease  \\\n",
              "Date                                                                         \n",
              "2014-01-03  3.98  4.00  3.88   4.00       4.00  22887200          Increase   \n",
              "2014-01-06  4.01  4.18  3.99   4.13       4.13  42398300          Increase   \n",
              "2014-01-07  4.19  4.25  4.11   4.18       4.18  42932100          Decrease   \n",
              "2014-01-08  4.23  4.26  4.14   4.18       4.18  30678700          Decrease   \n",
              "2014-01-09  4.20  4.23  4.05   4.09       4.09  30667600          Decrease   \n",
              "\n",
              "            Buy_Sell_on_Open  Buy_Sell   Returns  Average       Std  Month  \\\n",
              "Date                                                                         \n",
              "2014-01-03                 1         1  0.012658   3.9650  0.057446      1   \n",
              "2014-01-06                 1         1  0.032500   4.0775  0.092150      1   \n",
              "2014-01-07                 1         0  0.012107   4.1825  0.057373      1   \n",
              "2014-01-08                 0         0  0.000000   4.2025  0.053151      1   \n",
              "2014-01-09                 0         1 -0.021531   4.1425  0.086168      1   \n",
              "\n",
              "            Day  Year  Norm_Price Date_Stamp  \n",
              "Date                                          \n",
              "2014-01-03    3  2014    0.609272 2014-01-03  \n",
              "2014-01-06    6  2014    0.569722 2014-01-06  \n",
              "2014-01-07    7  2014   -0.043574 2014-01-07  \n",
              "2014-01-08    8  2014   -0.423324 2014-01-08  \n",
              "2014-01-09    9  2014   -0.609272 2014-01-09  "
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 45,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "Timeseries Feature Extraction"
      ],
      "metadata": {}
    },
    {
      "cell_type": "code",
      "source": [
        "from tsfresh import extract_features\n",
        "import tsfresh"
      ],
      "outputs": [],
      "execution_count": 46,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "df = dataset.reset_index()\n",
        "df.head()"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 76,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Date</th>\n",
              "      <th>Open</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Volume</th>\n",
              "      <th>Increase_Decrease</th>\n",
              "      <th>Buy_Sell_on_Open</th>\n",
              "      <th>Buy_Sell</th>\n",
              "      <th>Returns</th>\n",
              "      <th>Average</th>\n",
              "      <th>Std</th>\n",
              "      <th>Month</th>\n",
              "      <th>Day</th>\n",
              "      <th>Year</th>\n",
              "      <th>Norm_Price</th>\n",
              "      <th>Date_Stamp</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>2014-01-03</td>\n",
              "      <td>3.98</td>\n",
              "      <td>4.00</td>\n",
              "      <td>3.88</td>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>22887200</td>\n",
              "      <td>Increase</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.012658</td>\n",
              "      <td>3.9650</td>\n",
              "      <td>0.057446</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>2014</td>\n",
              "      <td>0.609272</td>\n",
              "      <td>2014-01-03</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2014-01-06</td>\n",
              "      <td>4.01</td>\n",
              "      <td>4.18</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.13</td>\n",
              "      <td>4.13</td>\n",
              "      <td>42398300</td>\n",
              "      <td>Increase</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.032500</td>\n",
              "      <td>4.0775</td>\n",
              "      <td>0.092150</td>\n",
              "      <td>1</td>\n",
              "      <td>6</td>\n",
              "      <td>2014</td>\n",
              "      <td>0.569722</td>\n",
              "      <td>2014-01-06</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>2014-01-07</td>\n",
              "      <td>4.19</td>\n",
              "      <td>4.25</td>\n",
              "      <td>4.11</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>42932100</td>\n",
              "      <td>Decrease</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>0.012107</td>\n",
              "      <td>4.1825</td>\n",
              "      <td>0.057373</td>\n",
              "      <td>1</td>\n",
              "      <td>7</td>\n",
              "      <td>2014</td>\n",
              "      <td>-0.043574</td>\n",
              "      <td>2014-01-07</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>2014-01-08</td>\n",
              "      <td>4.23</td>\n",
              "      <td>4.26</td>\n",
              "      <td>4.14</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>30678700</td>\n",
              "      <td>Decrease</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>0.000000</td>\n",
              "      <td>4.2025</td>\n",
              "      <td>0.053151</td>\n",
              "      <td>1</td>\n",
              "      <td>8</td>\n",
              "      <td>2014</td>\n",
              "      <td>-0.423324</td>\n",
              "      <td>2014-01-08</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>2014-01-09</td>\n",
              "      <td>4.20</td>\n",
              "      <td>4.23</td>\n",
              "      <td>4.05</td>\n",
              "      <td>4.09</td>\n",
              "      <td>4.09</td>\n",
              "      <td>30667600</td>\n",
              "      <td>Decrease</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>-0.021531</td>\n",
              "      <td>4.1425</td>\n",
              "      <td>0.086168</td>\n",
              "      <td>1</td>\n",
              "      <td>9</td>\n",
              "      <td>2014</td>\n",
              "      <td>-0.609272</td>\n",
              "      <td>2014-01-09</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "        Date  Open  High   Low  Close  Adj Close    Volume Increase_Decrease  \\\n",
              "0 2014-01-03  3.98  4.00  3.88   4.00       4.00  22887200          Increase   \n",
              "1 2014-01-06  4.01  4.18  3.99   4.13       4.13  42398300          Increase   \n",
              "2 2014-01-07  4.19  4.25  4.11   4.18       4.18  42932100          Decrease   \n",
              "3 2014-01-08  4.23  4.26  4.14   4.18       4.18  30678700          Decrease   \n",
              "4 2014-01-09  4.20  4.23  4.05   4.09       4.09  30667600          Decrease   \n",
              "\n",
              "   Buy_Sell_on_Open  Buy_Sell   Returns  Average       Std  Month  Day  Year  \\\n",
              "0                 1         1  0.012658   3.9650  0.057446      1    3  2014   \n",
              "1                 1         1  0.032500   4.0775  0.092150      1    6  2014   \n",
              "2                 1         0  0.012107   4.1825  0.057373      1    7  2014   \n",
              "3                 0         0  0.000000   4.2025  0.053151      1    8  2014   \n",
              "4                 0         1 -0.021531   4.1425  0.086168      1    9  2014   \n",
              "\n",
              "   Norm_Price Date_Stamp  \n",
              "0    0.609272 2014-01-03  \n",
              "1    0.569722 2014-01-06  \n",
              "2   -0.043574 2014-01-07  \n",
              "3   -0.423324 2014-01-08  \n",
              "4   -0.609272 2014-01-09  "
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 76,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "df = df.dropna(how='all')"
      ],
      "outputs": [],
      "execution_count": 80,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "new_features = extract_features(df[['Norm_Price', 'Day', 'Date_Stamp']], \n",
        "                              column_id=\"Day\", column_sort=\"Date_Stamp\", \n",
        "                              column_value=\"Norm_Price\", n_jobs=0).dropna(axis=1)"
      ],
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "Feature Extraction: 100%|██████████| 31/31 [00:03<00:00,  9.43it/s]\n"
          ]
        }
      ],
      "execution_count": 82,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "new_features"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 83,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th>variable</th>\n",
              "      <th>Norm_Price__abs_energy</th>\n",
              "      <th>Norm_Price__absolute_sum_of_changes</th>\n",
              "      <th>Norm_Price__agg_autocorrelation__f_agg_\"mean\"</th>\n",
              "      <th>Norm_Price__agg_autocorrelation__f_agg_\"median\"</th>\n",
              "      <th>Norm_Price__agg_autocorrelation__f_agg_\"var\"</th>\n",
              "      <th>Norm_Price__agg_linear_trend__f_agg_\"max\"__chunk_len_10__attr_\"intercept\"</th>\n",
              "      <th>Norm_Price__agg_linear_trend__f_agg_\"max\"__chunk_len_10__attr_\"rvalue\"</th>\n",
              "      <th>Norm_Price__agg_linear_trend__f_agg_\"max\"__chunk_len_10__attr_\"slope\"</th>\n",
              "      <th>Norm_Price__agg_linear_trend__f_agg_\"max\"__chunk_len_10__attr_\"stderr\"</th>\n",
              "      <th>Norm_Price__agg_linear_trend__f_agg_\"max\"__chunk_len_5__attr_\"intercept\"</th>\n",
              "      <th>...</th>\n",
              "      <th>Norm_Price__time_reversal_asymmetry_statistic__lag_1</th>\n",
              "      <th>Norm_Price__time_reversal_asymmetry_statistic__lag_2</th>\n",
              "      <th>Norm_Price__time_reversal_asymmetry_statistic__lag_3</th>\n",
              "      <th>Norm_Price__value_count__value_-inf</th>\n",
              "      <th>Norm_Price__value_count__value_0</th>\n",
              "      <th>Norm_Price__value_count__value_1</th>\n",
              "      <th>Norm_Price__value_count__value_inf</th>\n",
              "      <th>Norm_Price__value_count__value_nan</th>\n",
              "      <th>Norm_Price__variance</th>\n",
              "      <th>Norm_Price__variance_larger_than_standard_deviation</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>id</th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>10.069981</td>\n",
              "      <td>22.073335</td>\n",
              "      <td>0.011036</td>\n",
              "      <td>-0.000029</td>\n",
              "      <td>0.088425</td>\n",
              "      <td>0.723716</td>\n",
              "      <td>0.234293</td>\n",
              "      <td>0.028313</td>\n",
              "      <td>0.083072</td>\n",
              "      <td>0.593362</td>\n",
              "      <td>...</td>\n",
              "      <td>0.017921</td>\n",
              "      <td>-0.041509</td>\n",
              "      <td>-0.002697</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.284603</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>15.014855</td>\n",
              "      <td>23.650433</td>\n",
              "      <td>-0.068024</td>\n",
              "      <td>-0.032363</td>\n",
              "      <td>0.221351</td>\n",
              "      <td>0.765494</td>\n",
              "      <td>-0.232963</td>\n",
              "      <td>-0.044569</td>\n",
              "      <td>0.131558</td>\n",
              "      <td>0.717905</td>\n",
              "      <td>...</td>\n",
              "      <td>0.003614</td>\n",
              "      <td>-0.000761</td>\n",
              "      <td>0.010993</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.394286</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>10.007918</td>\n",
              "      <td>22.794906</td>\n",
              "      <td>-0.031558</td>\n",
              "      <td>0.007704</td>\n",
              "      <td>0.125220</td>\n",
              "      <td>0.650171</td>\n",
              "      <td>0.034617</td>\n",
              "      <td>0.005920</td>\n",
              "      <td>0.120853</td>\n",
              "      <td>0.721209</td>\n",
              "      <td>...</td>\n",
              "      <td>-0.016315</td>\n",
              "      <td>-0.022300</td>\n",
              "      <td>-0.032399</td>\n",
              "      <td>0.0</td>\n",
              "      <td>3.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.260806</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>7.622961</td>\n",
              "      <td>17.675706</td>\n",
              "      <td>-0.000024</td>\n",
              "      <td>0.018148</td>\n",
              "      <td>0.098133</td>\n",
              "      <td>0.740912</td>\n",
              "      <td>-0.195852</td>\n",
              "      <td>-0.047454</td>\n",
              "      <td>0.168012</td>\n",
              "      <td>0.649473</td>\n",
              "      <td>...</td>\n",
              "      <td>-0.004962</td>\n",
              "      <td>-0.023041</td>\n",
              "      <td>0.028284</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.224188</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>9.924642</td>\n",
              "      <td>20.377309</td>\n",
              "      <td>-0.068299</td>\n",
              "      <td>-0.006735</td>\n",
              "      <td>0.160274</td>\n",
              "      <td>0.665402</td>\n",
              "      <td>0.561299</td>\n",
              "      <td>0.058399</td>\n",
              "      <td>0.060886</td>\n",
              "      <td>0.551799</td>\n",
              "      <td>...</td>\n",
              "      <td>0.050581</td>\n",
              "      <td>-0.031490</td>\n",
              "      <td>-0.019719</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.257632</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6</th>\n",
              "      <td>12.313897</td>\n",
              "      <td>23.168678</td>\n",
              "      <td>-0.006238</td>\n",
              "      <td>-0.011870</td>\n",
              "      <td>0.153771</td>\n",
              "      <td>0.714396</td>\n",
              "      <td>0.628668</td>\n",
              "      <td>0.033060</td>\n",
              "      <td>0.023611</td>\n",
              "      <td>0.533903</td>\n",
              "      <td>...</td>\n",
              "      <td>-0.034664</td>\n",
              "      <td>0.016124</td>\n",
              "      <td>-0.026203</td>\n",
              "      <td>0.0</td>\n",
              "      <td>1.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.289533</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>7</th>\n",
              "      <td>9.634994</td>\n",
              "      <td>24.596423</td>\n",
              "      <td>-0.010482</td>\n",
              "      <td>0.036056</td>\n",
              "      <td>0.128040</td>\n",
              "      <td>0.712917</td>\n",
              "      <td>-0.083901</td>\n",
              "      <td>-0.008115</td>\n",
              "      <td>0.068147</td>\n",
              "      <td>0.555363</td>\n",
              "      <td>...</td>\n",
              "      <td>0.040656</td>\n",
              "      <td>0.028055</td>\n",
              "      <td>0.025381</td>\n",
              "      <td>0.0</td>\n",
              "      <td>1.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.242038</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>8</th>\n",
              "      <td>12.531512</td>\n",
              "      <td>28.226676</td>\n",
              "      <td>-0.016934</td>\n",
              "      <td>-0.049526</td>\n",
              "      <td>0.066014</td>\n",
              "      <td>0.776807</td>\n",
              "      <td>-0.169103</td>\n",
              "      <td>-0.005606</td>\n",
              "      <td>0.023103</td>\n",
              "      <td>0.584344</td>\n",
              "      <td>...</td>\n",
              "      <td>-0.014838</td>\n",
              "      <td>-0.006964</td>\n",
              "      <td>-0.050904</td>\n",
              "      <td>0.0</td>\n",
              "      <td>1.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.312205</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>9</th>\n",
              "      <td>11.037042</td>\n",
              "      <td>23.457618</td>\n",
              "      <td>0.014349</td>\n",
              "      <td>0.003432</td>\n",
              "      <td>0.111533</td>\n",
              "      <td>1.073800</td>\n",
              "      <td>-0.703534</td>\n",
              "      <td>-0.315431</td>\n",
              "      <td>0.183959</td>\n",
              "      <td>0.647062</td>\n",
              "      <td>...</td>\n",
              "      <td>-0.035327</td>\n",
              "      <td>-0.017039</td>\n",
              "      <td>-0.018024</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.250425</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>10</th>\n",
              "      <td>13.181257</td>\n",
              "      <td>25.853322</td>\n",
              "      <td>-0.005722</td>\n",
              "      <td>-0.044875</td>\n",
              "      <td>0.072481</td>\n",
              "      <td>0.696297</td>\n",
              "      <td>0.087233</td>\n",
              "      <td>0.009606</td>\n",
              "      <td>0.077565</td>\n",
              "      <td>0.526149</td>\n",
              "      <td>...</td>\n",
              "      <td>-0.008724</td>\n",
              "      <td>0.027061</td>\n",
              "      <td>-0.045334</td>\n",
              "      <td>0.0</td>\n",
              "      <td>1.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.325188</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>11</th>\n",
              "      <td>12.224303</td>\n",
              "      <td>27.566466</td>\n",
              "      <td>-0.035375</td>\n",
              "      <td>0.003080</td>\n",
              "      <td>0.057342</td>\n",
              "      <td>0.820669</td>\n",
              "      <td>-0.043514</td>\n",
              "      <td>-0.001800</td>\n",
              "      <td>0.029216</td>\n",
              "      <td>0.716743</td>\n",
              "      <td>...</td>\n",
              "      <td>-0.000965</td>\n",
              "      <td>-0.011177</td>\n",
              "      <td>0.027416</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.296249</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>12</th>\n",
              "      <td>11.264217</td>\n",
              "      <td>23.603288</td>\n",
              "      <td>-0.013589</td>\n",
              "      <td>0.001430</td>\n",
              "      <td>0.048710</td>\n",
              "      <td>0.706932</td>\n",
              "      <td>-0.055113</td>\n",
              "      <td>-0.003351</td>\n",
              "      <td>0.042924</td>\n",
              "      <td>0.581820</td>\n",
              "      <td>...</td>\n",
              "      <td>-0.017919</td>\n",
              "      <td>0.018315</td>\n",
              "      <td>-0.022212</td>\n",
              "      <td>0.0</td>\n",
              "      <td>2.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.286367</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>13</th>\n",
              "      <td>11.118758</td>\n",
              "      <td>24.107680</td>\n",
              "      <td>-0.018516</td>\n",
              "      <td>-0.038163</td>\n",
              "      <td>0.253449</td>\n",
              "      <td>0.619210</td>\n",
              "      <td>-0.144670</td>\n",
              "      <td>-0.013720</td>\n",
              "      <td>0.054180</td>\n",
              "      <td>0.473335</td>\n",
              "      <td>...</td>\n",
              "      <td>-0.028069</td>\n",
              "      <td>0.035023</td>\n",
              "      <td>0.029225</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.258843</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>14</th>\n",
              "      <td>12.454664</td>\n",
              "      <td>28.912105</td>\n",
              "      <td>-0.011057</td>\n",
              "      <td>0.001449</td>\n",
              "      <td>0.060746</td>\n",
              "      <td>0.847354</td>\n",
              "      <td>-0.680555</td>\n",
              "      <td>-0.042676</td>\n",
              "      <td>0.032488</td>\n",
              "      <td>0.901937</td>\n",
              "      <td>...</td>\n",
              "      <td>-0.021375</td>\n",
              "      <td>0.019155</td>\n",
              "      <td>-0.021709</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.319334</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>15</th>\n",
              "      <td>8.816213</td>\n",
              "      <td>20.694260</td>\n",
              "      <td>-0.036506</td>\n",
              "      <td>-0.040514</td>\n",
              "      <td>0.077388</td>\n",
              "      <td>0.480679</td>\n",
              "      <td>0.979965</td>\n",
              "      <td>0.122416</td>\n",
              "      <td>0.017593</td>\n",
              "      <td>0.256230</td>\n",
              "      <td>...</td>\n",
              "      <td>0.003415</td>\n",
              "      <td>-0.019177</td>\n",
              "      <td>0.012538</td>\n",
              "      <td>0.0</td>\n",
              "      <td>1.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.231178</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>16</th>\n",
              "      <td>13.557370</td>\n",
              "      <td>28.022055</td>\n",
              "      <td>0.001414</td>\n",
              "      <td>0.003748</td>\n",
              "      <td>0.148629</td>\n",
              "      <td>0.925799</td>\n",
              "      <td>-0.774326</td>\n",
              "      <td>-0.118937</td>\n",
              "      <td>0.068728</td>\n",
              "      <td>0.778106</td>\n",
              "      <td>...</td>\n",
              "      <td>0.000265</td>\n",
              "      <td>0.033296</td>\n",
              "      <td>-0.031002</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.347184</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>17</th>\n",
              "      <td>13.071540</td>\n",
              "      <td>24.628594</td>\n",
              "      <td>-0.101263</td>\n",
              "      <td>-0.011803</td>\n",
              "      <td>0.139477</td>\n",
              "      <td>0.616243</td>\n",
              "      <td>0.943906</td>\n",
              "      <td>0.086989</td>\n",
              "      <td>0.021519</td>\n",
              "      <td>0.544865</td>\n",
              "      <td>...</td>\n",
              "      <td>0.003547</td>\n",
              "      <td>0.041989</td>\n",
              "      <td>-0.021108</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.334629</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>18</th>\n",
              "      <td>10.554461</td>\n",
              "      <td>20.836253</td>\n",
              "      <td>-0.019547</td>\n",
              "      <td>0.009140</td>\n",
              "      <td>0.066878</td>\n",
              "      <td>0.795426</td>\n",
              "      <td>0.389645</td>\n",
              "      <td>0.011482</td>\n",
              "      <td>0.019190</td>\n",
              "      <td>0.613890</td>\n",
              "      <td>...</td>\n",
              "      <td>-0.003984</td>\n",
              "      <td>0.011569</td>\n",
              "      <td>0.010955</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.257025</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>19</th>\n",
              "      <td>10.418173</td>\n",
              "      <td>20.692454</td>\n",
              "      <td>-0.052621</td>\n",
              "      <td>-0.020736</td>\n",
              "      <td>0.039545</td>\n",
              "      <td>0.900034</td>\n",
              "      <td>-0.924970</td>\n",
              "      <td>-0.141270</td>\n",
              "      <td>0.041043</td>\n",
              "      <td>0.864496</td>\n",
              "      <td>...</td>\n",
              "      <td>0.007115</td>\n",
              "      <td>0.022104</td>\n",
              "      <td>0.032485</td>\n",
              "      <td>0.0</td>\n",
              "      <td>1.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.281143</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>20</th>\n",
              "      <td>13.783217</td>\n",
              "      <td>27.375898</td>\n",
              "      <td>-0.014296</td>\n",
              "      <td>-0.057376</td>\n",
              "      <td>0.079477</td>\n",
              "      <td>0.828027</td>\n",
              "      <td>-0.578073</td>\n",
              "      <td>-0.064066</td>\n",
              "      <td>0.063946</td>\n",
              "      <td>0.812330</td>\n",
              "      <td>...</td>\n",
              "      <td>0.029422</td>\n",
              "      <td>0.013044</td>\n",
              "      <td>-0.061445</td>\n",
              "      <td>0.0</td>\n",
              "      <td>1.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.353106</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>21</th>\n",
              "      <td>15.955669</td>\n",
              "      <td>28.573263</td>\n",
              "      <td>-0.028852</td>\n",
              "      <td>-0.024328</td>\n",
              "      <td>0.095393</td>\n",
              "      <td>0.847540</td>\n",
              "      <td>-0.751569</td>\n",
              "      <td>-0.013562</td>\n",
              "      <td>0.008417</td>\n",
              "      <td>0.852306</td>\n",
              "      <td>...</td>\n",
              "      <td>0.033873</td>\n",
              "      <td>-0.009516</td>\n",
              "      <td>0.003744</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.398113</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>22</th>\n",
              "      <td>12.063678</td>\n",
              "      <td>28.157227</td>\n",
              "      <td>-0.080530</td>\n",
              "      <td>0.019715</td>\n",
              "      <td>0.196439</td>\n",
              "      <td>0.826332</td>\n",
              "      <td>-0.120634</td>\n",
              "      <td>-0.004164</td>\n",
              "      <td>0.024232</td>\n",
              "      <td>0.722881</td>\n",
              "      <td>...</td>\n",
              "      <td>0.038789</td>\n",
              "      <td>-0.009683</td>\n",
              "      <td>0.009782</td>\n",
              "      <td>0.0</td>\n",
              "      <td>2.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.301438</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>23</th>\n",
              "      <td>11.688952</td>\n",
              "      <td>17.915731</td>\n",
              "      <td>-0.116997</td>\n",
              "      <td>-0.055423</td>\n",
              "      <td>0.091960</td>\n",
              "      <td>0.468470</td>\n",
              "      <td>0.749050</td>\n",
              "      <td>0.156800</td>\n",
              "      <td>0.098065</td>\n",
              "      <td>0.260465</td>\n",
              "      <td>...</td>\n",
              "      <td>-0.016534</td>\n",
              "      <td>-0.022134</td>\n",
              "      <td>0.043250</td>\n",
              "      <td>0.0</td>\n",
              "      <td>2.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.288256</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>24</th>\n",
              "      <td>10.920502</td>\n",
              "      <td>21.601054</td>\n",
              "      <td>-0.061047</td>\n",
              "      <td>-0.013141</td>\n",
              "      <td>0.111504</td>\n",
              "      <td>0.483477</td>\n",
              "      <td>0.902130</td>\n",
              "      <td>0.147021</td>\n",
              "      <td>0.049721</td>\n",
              "      <td>0.373425</td>\n",
              "      <td>...</td>\n",
              "      <td>-0.012664</td>\n",
              "      <td>0.016490</td>\n",
              "      <td>0.003476</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.279990</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>25</th>\n",
              "      <td>9.875040</td>\n",
              "      <td>15.589425</td>\n",
              "      <td>-0.007653</td>\n",
              "      <td>0.012757</td>\n",
              "      <td>0.050097</td>\n",
              "      <td>0.589862</td>\n",
              "      <td>-0.167542</td>\n",
              "      <td>-0.036731</td>\n",
              "      <td>0.152832</td>\n",
              "      <td>0.499332</td>\n",
              "      <td>...</td>\n",
              "      <td>-0.001071</td>\n",
              "      <td>-0.012131</td>\n",
              "      <td>-0.020231</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.263052</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>26</th>\n",
              "      <td>12.016991</td>\n",
              "      <td>23.163031</td>\n",
              "      <td>-0.010450</td>\n",
              "      <td>0.002650</td>\n",
              "      <td>0.045159</td>\n",
              "      <td>0.785450</td>\n",
              "      <td>0.039915</td>\n",
              "      <td>0.002180</td>\n",
              "      <td>0.038592</td>\n",
              "      <td>0.581023</td>\n",
              "      <td>...</td>\n",
              "      <td>0.035587</td>\n",
              "      <td>-0.037394</td>\n",
              "      <td>-0.030024</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.328597</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>27</th>\n",
              "      <td>12.341375</td>\n",
              "      <td>24.116540</td>\n",
              "      <td>0.018422</td>\n",
              "      <td>0.038060</td>\n",
              "      <td>0.062706</td>\n",
              "      <td>0.923514</td>\n",
              "      <td>-0.768526</td>\n",
              "      <td>-0.150382</td>\n",
              "      <td>0.088528</td>\n",
              "      <td>0.970088</td>\n",
              "      <td>...</td>\n",
              "      <td>0.061740</td>\n",
              "      <td>-0.026202</td>\n",
              "      <td>-0.029434</td>\n",
              "      <td>0.0</td>\n",
              "      <td>1.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.308123</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>28</th>\n",
              "      <td>12.799033</td>\n",
              "      <td>22.453745</td>\n",
              "      <td>0.015249</td>\n",
              "      <td>-0.028171</td>\n",
              "      <td>0.341807</td>\n",
              "      <td>0.712224</td>\n",
              "      <td>0.057811</td>\n",
              "      <td>0.005663</td>\n",
              "      <td>0.069154</td>\n",
              "      <td>0.558511</td>\n",
              "      <td>...</td>\n",
              "      <td>-0.003239</td>\n",
              "      <td>-0.033978</td>\n",
              "      <td>-0.038196</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.295680</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>29</th>\n",
              "      <td>10.912018</td>\n",
              "      <td>24.069628</td>\n",
              "      <td>-0.014600</td>\n",
              "      <td>-0.041823</td>\n",
              "      <td>0.117814</td>\n",
              "      <td>0.873552</td>\n",
              "      <td>-0.885844</td>\n",
              "      <td>-0.063219</td>\n",
              "      <td>0.023414</td>\n",
              "      <td>0.979154</td>\n",
              "      <td>...</td>\n",
              "      <td>-0.070521</td>\n",
              "      <td>0.044808</td>\n",
              "      <td>-0.005292</td>\n",
              "      <td>0.0</td>\n",
              "      <td>3.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.303008</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>30</th>\n",
              "      <td>9.593845</td>\n",
              "      <td>25.623378</td>\n",
              "      <td>-0.017433</td>\n",
              "      <td>0.035189</td>\n",
              "      <td>0.185818</td>\n",
              "      <td>0.827090</td>\n",
              "      <td>-0.569162</td>\n",
              "      <td>-0.053412</td>\n",
              "      <td>0.054560</td>\n",
              "      <td>0.597203</td>\n",
              "      <td>...</td>\n",
              "      <td>-0.004815</td>\n",
              "      <td>0.004700</td>\n",
              "      <td>-0.068674</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.275266</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>31</th>\n",
              "      <td>5.797197</td>\n",
              "      <td>11.104133</td>\n",
              "      <td>-0.013219</td>\n",
              "      <td>-0.063114</td>\n",
              "      <td>0.367888</td>\n",
              "      <td>0.932454</td>\n",
              "      <td>-0.889254</td>\n",
              "      <td>-0.578549</td>\n",
              "      <td>0.297593</td>\n",
              "      <td>0.782239</td>\n",
              "      <td>...</td>\n",
              "      <td>-0.044425</td>\n",
              "      <td>0.016684</td>\n",
              "      <td>-0.011907</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.251496</td>\n",
              "      <td>0.0</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>31 rows × 421 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "variable  Norm_Price__abs_energy  Norm_Price__absolute_sum_of_changes  \\\n",
              "id                                                                      \n",
              "1                      10.069981                            22.073335   \n",
              "2                      15.014855                            23.650433   \n",
              "3                      10.007918                            22.794906   \n",
              "4                       7.622961                            17.675706   \n",
              "5                       9.924642                            20.377309   \n",
              "6                      12.313897                            23.168678   \n",
              "7                       9.634994                            24.596423   \n",
              "8                      12.531512                            28.226676   \n",
              "9                      11.037042                            23.457618   \n",
              "10                     13.181257                            25.853322   \n",
              "11                     12.224303                            27.566466   \n",
              "12                     11.264217                            23.603288   \n",
              "13                     11.118758                            24.107680   \n",
              "14                     12.454664                            28.912105   \n",
              "15                      8.816213                            20.694260   \n",
              "16                     13.557370                            28.022055   \n",
              "17                     13.071540                            24.628594   \n",
              "18                     10.554461                            20.836253   \n",
              "19                     10.418173                            20.692454   \n",
              "20                     13.783217                            27.375898   \n",
              "21                     15.955669                            28.573263   \n",
              "22                     12.063678                            28.157227   \n",
              "23                     11.688952                            17.915731   \n",
              "24                     10.920502                            21.601054   \n",
              "25                      9.875040                            15.589425   \n",
              "26                     12.016991                            23.163031   \n",
              "27                     12.341375                            24.116540   \n",
              "28                     12.799033                            22.453745   \n",
              "29                     10.912018                            24.069628   \n",
              "30                      9.593845                            25.623378   \n",
              "31                      5.797197                            11.104133   \n",
              "\n",
              "variable  Norm_Price__agg_autocorrelation__f_agg_\"mean\"  \\\n",
              "id                                                        \n",
              "1                                              0.011036   \n",
              "2                                             -0.068024   \n",
              "3                                             -0.031558   \n",
              "4                                             -0.000024   \n",
              "5                                             -0.068299   \n",
              "6                                             -0.006238   \n",
              "7                                             -0.010482   \n",
              "8                                             -0.016934   \n",
              "9                                              0.014349   \n",
              "10                                            -0.005722   \n",
              "11                                            -0.035375   \n",
              "12                                            -0.013589   \n",
              "13                                            -0.018516   \n",
              "14                                            -0.011057   \n",
              "15                                            -0.036506   \n",
              "16                                             0.001414   \n",
              "17                                            -0.101263   \n",
              "18                                            -0.019547   \n",
              "19                                            -0.052621   \n",
              "20                                            -0.014296   \n",
              "21                                            -0.028852   \n",
              "22                                            -0.080530   \n",
              "23                                            -0.116997   \n",
              "24                                            -0.061047   \n",
              "25                                            -0.007653   \n",
              "26                                            -0.010450   \n",
              "27                                             0.018422   \n",
              "28                                             0.015249   \n",
              "29                                            -0.014600   \n",
              "30                                            -0.017433   \n",
              "31                                            -0.013219   \n",
              "\n",
              "variable  Norm_Price__agg_autocorrelation__f_agg_\"median\"  \\\n",
              "id                                                          \n",
              "1                                               -0.000029   \n",
              "2                                               -0.032363   \n",
              "3                                                0.007704   \n",
              "4                                                0.018148   \n",
              "5                                               -0.006735   \n",
              "6                                               -0.011870   \n",
              "7                                                0.036056   \n",
              "8                                               -0.049526   \n",
              "9                                                0.003432   \n",
              "10                                              -0.044875   \n",
              "11                                               0.003080   \n",
              "12                                               0.001430   \n",
              "13                                              -0.038163   \n",
              "14                                               0.001449   \n",
              "15                                              -0.040514   \n",
              "16                                               0.003748   \n",
              "17                                              -0.011803   \n",
              "18                                               0.009140   \n",
              "19                                              -0.020736   \n",
              "20                                              -0.057376   \n",
              "21                                              -0.024328   \n",
              "22                                               0.019715   \n",
              "23                                              -0.055423   \n",
              "24                                              -0.013141   \n",
              "25                                               0.012757   \n",
              "26                                               0.002650   \n",
              "27                                               0.038060   \n",
              "28                                              -0.028171   \n",
              "29                                              -0.041823   \n",
              "30                                               0.035189   \n",
              "31                                              -0.063114   \n",
              "\n",
              "variable  Norm_Price__agg_autocorrelation__f_agg_\"var\"  \\\n",
              "id                                                       \n",
              "1                                             0.088425   \n",
              "2                                             0.221351   \n",
              "3                                             0.125220   \n",
              "4                                             0.098133   \n",
              "5                                             0.160274   \n",
              "6                                             0.153771   \n",
              "7                                             0.128040   \n",
              "8                                             0.066014   \n",
              "9                                             0.111533   \n",
              "10                                            0.072481   \n",
              "11                                            0.057342   \n",
              "12                                            0.048710   \n",
              "13                                            0.253449   \n",
              "14                                            0.060746   \n",
              "15                                            0.077388   \n",
              "16                                            0.148629   \n",
              "17                                            0.139477   \n",
              "18                                            0.066878   \n",
              "19                                            0.039545   \n",
              "20                                            0.079477   \n",
              "21                                            0.095393   \n",
              "22                                            0.196439   \n",
              "23                                            0.091960   \n",
              "24                                            0.111504   \n",
              "25                                            0.050097   \n",
              "26                                            0.045159   \n",
              "27                                            0.062706   \n",
              "28                                            0.341807   \n",
              "29                                            0.117814   \n",
              "30                                            0.185818   \n",
              "31                                            0.367888   \n",
              "\n",
              "variable  Norm_Price__agg_linear_trend__f_agg_\"max\"__chunk_len_10__attr_\"intercept\"  \\\n",
              "id                                                                                    \n",
              "1                                                  0.723716                           \n",
              "2                                                  0.765494                           \n",
              "3                                                  0.650171                           \n",
              "4                                                  0.740912                           \n",
              "5                                                  0.665402                           \n",
              "6                                                  0.714396                           \n",
              "7                                                  0.712917                           \n",
              "8                                                  0.776807                           \n",
              "9                                                  1.073800                           \n",
              "10                                                 0.696297                           \n",
              "11                                                 0.820669                           \n",
              "12                                                 0.706932                           \n",
              "13                                                 0.619210                           \n",
              "14                                                 0.847354                           \n",
              "15                                                 0.480679                           \n",
              "16                                                 0.925799                           \n",
              "17                                                 0.616243                           \n",
              "18                                                 0.795426                           \n",
              "19                                                 0.900034                           \n",
              "20                                                 0.828027                           \n",
              "21                                                 0.847540                           \n",
              "22                                                 0.826332                           \n",
              "23                                                 0.468470                           \n",
              "24                                                 0.483477                           \n",
              "25                                                 0.589862                           \n",
              "26                                                 0.785450                           \n",
              "27                                                 0.923514                           \n",
              "28                                                 0.712224                           \n",
              "29                                                 0.873552                           \n",
              "30                                                 0.827090                           \n",
              "31                                                 0.932454                           \n",
              "\n",
              "variable  Norm_Price__agg_linear_trend__f_agg_\"max\"__chunk_len_10__attr_\"rvalue\"  \\\n",
              "id                                                                                 \n",
              "1                                                  0.234293                        \n",
              "2                                                 -0.232963                        \n",
              "3                                                  0.034617                        \n",
              "4                                                 -0.195852                        \n",
              "5                                                  0.561299                        \n",
              "6                                                  0.628668                        \n",
              "7                                                 -0.083901                        \n",
              "8                                                 -0.169103                        \n",
              "9                                                 -0.703534                        \n",
              "10                                                 0.087233                        \n",
              "11                                                -0.043514                        \n",
              "12                                                -0.055113                        \n",
              "13                                                -0.144670                        \n",
              "14                                                -0.680555                        \n",
              "15                                                 0.979965                        \n",
              "16                                                -0.774326                        \n",
              "17                                                 0.943906                        \n",
              "18                                                 0.389645                        \n",
              "19                                                -0.924970                        \n",
              "20                                                -0.578073                        \n",
              "21                                                -0.751569                        \n",
              "22                                                -0.120634                        \n",
              "23                                                 0.749050                        \n",
              "24                                                 0.902130                        \n",
              "25                                                -0.167542                        \n",
              "26                                                 0.039915                        \n",
              "27                                                -0.768526                        \n",
              "28                                                 0.057811                        \n",
              "29                                                -0.885844                        \n",
              "30                                                -0.569162                        \n",
              "31                                                -0.889254                        \n",
              "\n",
              "variable  Norm_Price__agg_linear_trend__f_agg_\"max\"__chunk_len_10__attr_\"slope\"  \\\n",
              "id                                                                                \n",
              "1                                                  0.028313                       \n",
              "2                                                 -0.044569                       \n",
              "3                                                  0.005920                       \n",
              "4                                                 -0.047454                       \n",
              "5                                                  0.058399                       \n",
              "6                                                  0.033060                       \n",
              "7                                                 -0.008115                       \n",
              "8                                                 -0.005606                       \n",
              "9                                                 -0.315431                       \n",
              "10                                                 0.009606                       \n",
              "11                                                -0.001800                       \n",
              "12                                                -0.003351                       \n",
              "13                                                -0.013720                       \n",
              "14                                                -0.042676                       \n",
              "15                                                 0.122416                       \n",
              "16                                                -0.118937                       \n",
              "17                                                 0.086989                       \n",
              "18                                                 0.011482                       \n",
              "19                                                -0.141270                       \n",
              "20                                                -0.064066                       \n",
              "21                                                -0.013562                       \n",
              "22                                                -0.004164                       \n",
              "23                                                 0.156800                       \n",
              "24                                                 0.147021                       \n",
              "25                                                -0.036731                       \n",
              "26                                                 0.002180                       \n",
              "27                                                -0.150382                       \n",
              "28                                                 0.005663                       \n",
              "29                                                -0.063219                       \n",
              "30                                                -0.053412                       \n",
              "31                                                -0.578549                       \n",
              "\n",
              "variable  Norm_Price__agg_linear_trend__f_agg_\"max\"__chunk_len_10__attr_\"stderr\"  \\\n",
              "id                                                                                 \n",
              "1                                                  0.083072                        \n",
              "2                                                  0.131558                        \n",
              "3                                                  0.120853                        \n",
              "4                                                  0.168012                        \n",
              "5                                                  0.060886                        \n",
              "6                                                  0.023611                        \n",
              "7                                                  0.068147                        \n",
              "8                                                  0.023103                        \n",
              "9                                                  0.183959                        \n",
              "10                                                 0.077565                        \n",
              "11                                                 0.029216                        \n",
              "12                                                 0.042924                        \n",
              "13                                                 0.054180                        \n",
              "14                                                 0.032488                        \n",
              "15                                                 0.017593                        \n",
              "16                                                 0.068728                        \n",
              "17                                                 0.021519                        \n",
              "18                                                 0.019190                        \n",
              "19                                                 0.041043                        \n",
              "20                                                 0.063946                        \n",
              "21                                                 0.008417                        \n",
              "22                                                 0.024232                        \n",
              "23                                                 0.098065                        \n",
              "24                                                 0.049721                        \n",
              "25                                                 0.152832                        \n",
              "26                                                 0.038592                        \n",
              "27                                                 0.088528                        \n",
              "28                                                 0.069154                        \n",
              "29                                                 0.023414                        \n",
              "30                                                 0.054560                        \n",
              "31                                                 0.297593                        \n",
              "\n",
              "variable  Norm_Price__agg_linear_trend__f_agg_\"max\"__chunk_len_5__attr_\"intercept\"  \\\n",
              "id                                                                                   \n",
              "1                                                  0.593362                          \n",
              "2                                                  0.717905                          \n",
              "3                                                  0.721209                          \n",
              "4                                                  0.649473                          \n",
              "5                                                  0.551799                          \n",
              "6                                                  0.533903                          \n",
              "7                                                  0.555363                          \n",
              "8                                                  0.584344                          \n",
              "9                                                  0.647062                          \n",
              "10                                                 0.526149                          \n",
              "11                                                 0.716743                          \n",
              "12                                                 0.581820                          \n",
              "13                                                 0.473335                          \n",
              "14                                                 0.901937                          \n",
              "15                                                 0.256230                          \n",
              "16                                                 0.778106                          \n",
              "17                                                 0.544865                          \n",
              "18                                                 0.613890                          \n",
              "19                                                 0.864496                          \n",
              "20                                                 0.812330                          \n",
              "21                                                 0.852306                          \n",
              "22                                                 0.722881                          \n",
              "23                                                 0.260465                          \n",
              "24                                                 0.373425                          \n",
              "25                                                 0.499332                          \n",
              "26                                                 0.581023                          \n",
              "27                                                 0.970088                          \n",
              "28                                                 0.558511                          \n",
              "29                                                 0.979154                          \n",
              "30                                                 0.597203                          \n",
              "31                                                 0.782239                          \n",
              "\n",
              "variable                         ...                           \\\n",
              "id                               ...                            \n",
              "1                                ...                            \n",
              "2                                ...                            \n",
              "3                                ...                            \n",
              "4                                ...                            \n",
              "5                                ...                            \n",
              "6                                ...                            \n",
              "7                                ...                            \n",
              "8                                ...                            \n",
              "9                                ...                            \n",
              "10                               ...                            \n",
              "11                               ...                            \n",
              "12                               ...                            \n",
              "13                               ...                            \n",
              "14                               ...                            \n",
              "15                               ...                            \n",
              "16                               ...                            \n",
              "17                               ...                            \n",
              "18                               ...                            \n",
              "19                               ...                            \n",
              "20                               ...                            \n",
              "21                               ...                            \n",
              "22                               ...                            \n",
              "23                               ...                            \n",
              "24                               ...                            \n",
              "25                               ...                            \n",
              "26                               ...                            \n",
              "27                               ...                            \n",
              "28                               ...                            \n",
              "29                               ...                            \n",
              "30                               ...                            \n",
              "31                               ...                            \n",
              "\n",
              "variable  Norm_Price__time_reversal_asymmetry_statistic__lag_1  \\\n",
              "id                                                               \n",
              "1                                                  0.017921      \n",
              "2                                                  0.003614      \n",
              "3                                                 -0.016315      \n",
              "4                                                 -0.004962      \n",
              "5                                                  0.050581      \n",
              "6                                                 -0.034664      \n",
              "7                                                  0.040656      \n",
              "8                                                 -0.014838      \n",
              "9                                                 -0.035327      \n",
              "10                                                -0.008724      \n",
              "11                                                -0.000965      \n",
              "12                                                -0.017919      \n",
              "13                                                -0.028069      \n",
              "14                                                -0.021375      \n",
              "15                                                 0.003415      \n",
              "16                                                 0.000265      \n",
              "17                                                 0.003547      \n",
              "18                                                -0.003984      \n",
              "19                                                 0.007115      \n",
              "20                                                 0.029422      \n",
              "21                                                 0.033873      \n",
              "22                                                 0.038789      \n",
              "23                                                -0.016534      \n",
              "24                                                -0.012664      \n",
              "25                                                -0.001071      \n",
              "26                                                 0.035587      \n",
              "27                                                 0.061740      \n",
              "28                                                -0.003239      \n",
              "29                                                -0.070521      \n",
              "30                                                -0.004815      \n",
              "31                                                -0.044425      \n",
              "\n",
              "variable  Norm_Price__time_reversal_asymmetry_statistic__lag_2  \\\n",
              "id                                                               \n",
              "1                                                 -0.041509      \n",
              "2                                                 -0.000761      \n",
              "3                                                 -0.022300      \n",
              "4                                                 -0.023041      \n",
              "5                                                 -0.031490      \n",
              "6                                                  0.016124      \n",
              "7                                                  0.028055      \n",
              "8                                                 -0.006964      \n",
              "9                                                 -0.017039      \n",
              "10                                                 0.027061      \n",
              "11                                                -0.011177      \n",
              "12                                                 0.018315      \n",
              "13                                                 0.035023      \n",
              "14                                                 0.019155      \n",
              "15                                                -0.019177      \n",
              "16                                                 0.033296      \n",
              "17                                                 0.041989      \n",
              "18                                                 0.011569      \n",
              "19                                                 0.022104      \n",
              "20                                                 0.013044      \n",
              "21                                                -0.009516      \n",
              "22                                                -0.009683      \n",
              "23                                                -0.022134      \n",
              "24                                                 0.016490      \n",
              "25                                                -0.012131      \n",
              "26                                                -0.037394      \n",
              "27                                                -0.026202      \n",
              "28                                                -0.033978      \n",
              "29                                                 0.044808      \n",
              "30                                                 0.004700      \n",
              "31                                                 0.016684      \n",
              "\n",
              "variable  Norm_Price__time_reversal_asymmetry_statistic__lag_3  \\\n",
              "id                                                               \n",
              "1                                                 -0.002697      \n",
              "2                                                  0.010993      \n",
              "3                                                 -0.032399      \n",
              "4                                                  0.028284      \n",
              "5                                                 -0.019719      \n",
              "6                                                 -0.026203      \n",
              "7                                                  0.025381      \n",
              "8                                                 -0.050904      \n",
              "9                                                 -0.018024      \n",
              "10                                                -0.045334      \n",
              "11                                                 0.027416      \n",
              "12                                                -0.022212      \n",
              "13                                                 0.029225      \n",
              "14                                                -0.021709      \n",
              "15                                                 0.012538      \n",
              "16                                                -0.031002      \n",
              "17                                                -0.021108      \n",
              "18                                                 0.010955      \n",
              "19                                                 0.032485      \n",
              "20                                                -0.061445      \n",
              "21                                                 0.003744      \n",
              "22                                                 0.009782      \n",
              "23                                                 0.043250      \n",
              "24                                                 0.003476      \n",
              "25                                                -0.020231      \n",
              "26                                                -0.030024      \n",
              "27                                                -0.029434      \n",
              "28                                                -0.038196      \n",
              "29                                                -0.005292      \n",
              "30                                                -0.068674      \n",
              "31                                                -0.011907      \n",
              "\n",
              "variable  Norm_Price__value_count__value_-inf  \\\n",
              "id                                              \n",
              "1                                         0.0   \n",
              "2                                         0.0   \n",
              "3                                         0.0   \n",
              "4                                         0.0   \n",
              "5                                         0.0   \n",
              "6                                         0.0   \n",
              "7                                         0.0   \n",
              "8                                         0.0   \n",
              "9                                         0.0   \n",
              "10                                        0.0   \n",
              "11                                        0.0   \n",
              "12                                        0.0   \n",
              "13                                        0.0   \n",
              "14                                        0.0   \n",
              "15                                        0.0   \n",
              "16                                        0.0   \n",
              "17                                        0.0   \n",
              "18                                        0.0   \n",
              "19                                        0.0   \n",
              "20                                        0.0   \n",
              "21                                        0.0   \n",
              "22                                        0.0   \n",
              "23                                        0.0   \n",
              "24                                        0.0   \n",
              "25                                        0.0   \n",
              "26                                        0.0   \n",
              "27                                        0.0   \n",
              "28                                        0.0   \n",
              "29                                        0.0   \n",
              "30                                        0.0   \n",
              "31                                        0.0   \n",
              "\n",
              "variable  Norm_Price__value_count__value_0  Norm_Price__value_count__value_1  \\\n",
              "id                                                                             \n",
              "1                                      0.0                               0.0   \n",
              "2                                      0.0                               0.0   \n",
              "3                                      3.0                               0.0   \n",
              "4                                      0.0                               0.0   \n",
              "5                                      0.0                               0.0   \n",
              "6                                      1.0                               0.0   \n",
              "7                                      1.0                               0.0   \n",
              "8                                      1.0                               0.0   \n",
              "9                                      0.0                               0.0   \n",
              "10                                     1.0                               0.0   \n",
              "11                                     0.0                               0.0   \n",
              "12                                     2.0                               0.0   \n",
              "13                                     0.0                               0.0   \n",
              "14                                     0.0                               0.0   \n",
              "15                                     1.0                               0.0   \n",
              "16                                     0.0                               0.0   \n",
              "17                                     0.0                               0.0   \n",
              "18                                     0.0                               0.0   \n",
              "19                                     1.0                               0.0   \n",
              "20                                     1.0                               0.0   \n",
              "21                                     0.0                               0.0   \n",
              "22                                     2.0                               0.0   \n",
              "23                                     2.0                               0.0   \n",
              "24                                     0.0                               0.0   \n",
              "25                                     0.0                               0.0   \n",
              "26                                     0.0                               0.0   \n",
              "27                                     1.0                               0.0   \n",
              "28                                     0.0                               0.0   \n",
              "29                                     3.0                               0.0   \n",
              "30                                     0.0                               0.0   \n",
              "31                                     0.0                               0.0   \n",
              "\n",
              "variable  Norm_Price__value_count__value_inf  \\\n",
              "id                                             \n",
              "1                                        0.0   \n",
              "2                                        0.0   \n",
              "3                                        0.0   \n",
              "4                                        0.0   \n",
              "5                                        0.0   \n",
              "6                                        0.0   \n",
              "7                                        0.0   \n",
              "8                                        0.0   \n",
              "9                                        0.0   \n",
              "10                                       0.0   \n",
              "11                                       0.0   \n",
              "12                                       0.0   \n",
              "13                                       0.0   \n",
              "14                                       0.0   \n",
              "15                                       0.0   \n",
              "16                                       0.0   \n",
              "17                                       0.0   \n",
              "18                                       0.0   \n",
              "19                                       0.0   \n",
              "20                                       0.0   \n",
              "21                                       0.0   \n",
              "22                                       0.0   \n",
              "23                                       0.0   \n",
              "24                                       0.0   \n",
              "25                                       0.0   \n",
              "26                                       0.0   \n",
              "27                                       0.0   \n",
              "28                                       0.0   \n",
              "29                                       0.0   \n",
              "30                                       0.0   \n",
              "31                                       0.0   \n",
              "\n",
              "variable  Norm_Price__value_count__value_nan  Norm_Price__variance  \\\n",
              "id                                                                   \n",
              "1                                        0.0              0.284603   \n",
              "2                                        0.0              0.394286   \n",
              "3                                        0.0              0.260806   \n",
              "4                                        0.0              0.224188   \n",
              "5                                        0.0              0.257632   \n",
              "6                                        0.0              0.289533   \n",
              "7                                        0.0              0.242038   \n",
              "8                                        0.0              0.312205   \n",
              "9                                        0.0              0.250425   \n",
              "10                                       0.0              0.325188   \n",
              "11                                       0.0              0.296249   \n",
              "12                                       0.0              0.286367   \n",
              "13                                       0.0              0.258843   \n",
              "14                                       0.0              0.319334   \n",
              "15                                       0.0              0.231178   \n",
              "16                                       0.0              0.347184   \n",
              "17                                       0.0              0.334629   \n",
              "18                                       0.0              0.257025   \n",
              "19                                       0.0              0.281143   \n",
              "20                                       0.0              0.353106   \n",
              "21                                       0.0              0.398113   \n",
              "22                                       0.0              0.301438   \n",
              "23                                       0.0              0.288256   \n",
              "24                                       0.0              0.279990   \n",
              "25                                       0.0              0.263052   \n",
              "26                                       0.0              0.328597   \n",
              "27                                       0.0              0.308123   \n",
              "28                                       0.0              0.295680   \n",
              "29                                       0.0              0.303008   \n",
              "30                                       0.0              0.275266   \n",
              "31                                       0.0              0.251496   \n",
              "\n",
              "variable  Norm_Price__variance_larger_than_standard_deviation  \n",
              "id                                                             \n",
              "1                                                       0.0    \n",
              "2                                                       0.0    \n",
              "3                                                       0.0    \n",
              "4                                                       0.0    \n",
              "5                                                       0.0    \n",
              "6                                                       0.0    \n",
              "7                                                       0.0    \n",
              "8                                                       0.0    \n",
              "9                                                       0.0    \n",
              "10                                                      0.0    \n",
              "11                                                      0.0    \n",
              "12                                                      0.0    \n",
              "13                                                      0.0    \n",
              "14                                                      0.0    \n",
              "15                                                      0.0    \n",
              "16                                                      0.0    \n",
              "17                                                      0.0    \n",
              "18                                                      0.0    \n",
              "19                                                      0.0    \n",
              "20                                                      0.0    \n",
              "21                                                      0.0    \n",
              "22                                                      0.0    \n",
              "23                                                      0.0    \n",
              "24                                                      0.0    \n",
              "25                                                      0.0    \n",
              "26                                                      0.0    \n",
              "27                                                      0.0    \n",
              "28                                                      0.0    \n",
              "29                                                      0.0    \n",
              "30                                                      0.0    \n",
              "31                                                      0.0    \n",
              "\n[31 rows x 421 columns]"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 83,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "X = extract_features(df, column_id='Month', column_sort='Date', column_value='Adj Close')"
      ],
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "Feature Extraction: 100%|██████████| 12/12 [00:02<00:00,  5.12it/s]\n"
          ]
        }
      ],
      "execution_count": 84,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "X"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 85,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th>variable</th>\n",
              "      <th>Adj Close__abs_energy</th>\n",
              "      <th>Adj Close__absolute_sum_of_changes</th>\n",
              "      <th>Adj Close__agg_autocorrelation__f_agg_\"mean\"</th>\n",
              "      <th>Adj Close__agg_autocorrelation__f_agg_\"median\"</th>\n",
              "      <th>Adj Close__agg_autocorrelation__f_agg_\"var\"</th>\n",
              "      <th>Adj Close__agg_linear_trend__f_agg_\"max\"__chunk_len_10__attr_\"intercept\"</th>\n",
              "      <th>Adj Close__agg_linear_trend__f_agg_\"max\"__chunk_len_10__attr_\"rvalue\"</th>\n",
              "      <th>Adj Close__agg_linear_trend__f_agg_\"max\"__chunk_len_10__attr_\"slope\"</th>\n",
              "      <th>Adj Close__agg_linear_trend__f_agg_\"max\"__chunk_len_10__attr_\"stderr\"</th>\n",
              "      <th>Adj Close__agg_linear_trend__f_agg_\"max\"__chunk_len_50__attr_\"intercept\"</th>\n",
              "      <th>...</th>\n",
              "      <th>Adj Close__time_reversal_asymmetry_statistic__lag_1</th>\n",
              "      <th>Adj Close__time_reversal_asymmetry_statistic__lag_2</th>\n",
              "      <th>Adj Close__time_reversal_asymmetry_statistic__lag_3</th>\n",
              "      <th>Adj Close__value_count__value_-inf</th>\n",
              "      <th>Adj Close__value_count__value_0</th>\n",
              "      <th>Adj Close__value_count__value_1</th>\n",
              "      <th>Adj Close__value_count__value_inf</th>\n",
              "      <th>Adj Close__value_count__value_nan</th>\n",
              "      <th>Adj Close__variance</th>\n",
              "      <th>Adj Close__variance_larger_than_standard_deviation</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>id</th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>6019.416900</td>\n",
              "      <td>26.540000</td>\n",
              "      <td>0.354006</td>\n",
              "      <td>0.432519</td>\n",
              "      <td>0.175319</td>\n",
              "      <td>1.730545</td>\n",
              "      <td>0.860689</td>\n",
              "      <td>1.337879</td>\n",
              "      <td>0.279805</td>\n",
              "      <td>4.470000</td>\n",
              "      <td>...</td>\n",
              "      <td>28.749453</td>\n",
              "      <td>57.362763</td>\n",
              "      <td>83.149545</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>18.781676</td>\n",
              "      <td>1.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>6705.488100</td>\n",
              "      <td>27.860000</td>\n",
              "      <td>0.275627</td>\n",
              "      <td>0.274121</td>\n",
              "      <td>0.205653</td>\n",
              "      <td>1.630727</td>\n",
              "      <td>0.823661</td>\n",
              "      <td>1.454727</td>\n",
              "      <td>0.354107</td>\n",
              "      <td>3.720000</td>\n",
              "      <td>...</td>\n",
              "      <td>22.531925</td>\n",
              "      <td>45.286815</td>\n",
              "      <td>65.917476</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>24.022986</td>\n",
              "      <td>1.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>7702.374500</td>\n",
              "      <td>31.760000</td>\n",
              "      <td>0.370745</td>\n",
              "      <td>0.409414</td>\n",
              "      <td>0.170077</td>\n",
              "      <td>1.773636</td>\n",
              "      <td>0.767598</td>\n",
              "      <td>1.246727</td>\n",
              "      <td>0.346998</td>\n",
              "      <td>6.456667</td>\n",
              "      <td>...</td>\n",
              "      <td>6.108310</td>\n",
              "      <td>14.899758</td>\n",
              "      <td>27.105037</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>22.682310</td>\n",
              "      <td>1.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>6168.877000</td>\n",
              "      <td>33.650000</td>\n",
              "      <td>0.310897</td>\n",
              "      <td>0.334679</td>\n",
              "      <td>0.171170</td>\n",
              "      <td>2.242727</td>\n",
              "      <td>0.757335</td>\n",
              "      <td>1.106545</td>\n",
              "      <td>0.318047</td>\n",
              "      <td>6.611667</td>\n",
              "      <td>...</td>\n",
              "      <td>12.330922</td>\n",
              "      <td>23.026106</td>\n",
              "      <td>32.808871</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>18.265710</td>\n",
              "      <td>1.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>6890.726000</td>\n",
              "      <td>28.450000</td>\n",
              "      <td>0.467041</td>\n",
              "      <td>0.551048</td>\n",
              "      <td>0.136986</td>\n",
              "      <td>1.721364</td>\n",
              "      <td>0.853270</td>\n",
              "      <td>1.247364</td>\n",
              "      <td>0.254106</td>\n",
              "      <td>5.736667</td>\n",
              "      <td>...</td>\n",
              "      <td>30.335133</td>\n",
              "      <td>61.237832</td>\n",
              "      <td>91.868611</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>17.713980</td>\n",
              "      <td>1.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6</th>\n",
              "      <td>9564.220168</td>\n",
              "      <td>34.500002</td>\n",
              "      <td>0.489733</td>\n",
              "      <td>0.566027</td>\n",
              "      <td>0.143772</td>\n",
              "      <td>1.204091</td>\n",
              "      <td>0.912175</td>\n",
              "      <td>1.584273</td>\n",
              "      <td>0.237248</td>\n",
              "      <td>6.716667</td>\n",
              "      <td>...</td>\n",
              "      <td>42.316454</td>\n",
              "      <td>86.953030</td>\n",
              "      <td>135.130659</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>27.107963</td>\n",
              "      <td>1.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>7</th>\n",
              "      <td>10788.664338</td>\n",
              "      <td>33.990004</td>\n",
              "      <td>0.475292</td>\n",
              "      <td>0.568334</td>\n",
              "      <td>0.152314</td>\n",
              "      <td>1.007727</td>\n",
              "      <td>0.919332</td>\n",
              "      <td>1.764636</td>\n",
              "      <td>0.251760</td>\n",
              "      <td>6.636667</td>\n",
              "      <td>...</td>\n",
              "      <td>85.408064</td>\n",
              "      <td>170.623756</td>\n",
              "      <td>225.458101</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>33.772204</td>\n",
              "      <td>1.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>8</th>\n",
              "      <td>13088.049644</td>\n",
              "      <td>39.550004</td>\n",
              "      <td>0.470143</td>\n",
              "      <td>0.476228</td>\n",
              "      <td>0.092382</td>\n",
              "      <td>-0.120455</td>\n",
              "      <td>0.934536</td>\n",
              "      <td>2.199909</td>\n",
              "      <td>0.279240</td>\n",
              "      <td>8.030000</td>\n",
              "      <td>...</td>\n",
              "      <td>187.013637</td>\n",
              "      <td>315.085442</td>\n",
              "      <td>423.155964</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>41.308127</td>\n",
              "      <td>1.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>9</th>\n",
              "      <td>4536.335000</td>\n",
              "      <td>23.910000</td>\n",
              "      <td>0.204146</td>\n",
              "      <td>0.215385</td>\n",
              "      <td>0.239502</td>\n",
              "      <td>1.587333</td>\n",
              "      <td>0.866586</td>\n",
              "      <td>1.467333</td>\n",
              "      <td>0.319369</td>\n",
              "      <td>7.510000</td>\n",
              "      <td>...</td>\n",
              "      <td>31.148060</td>\n",
              "      <td>62.606912</td>\n",
              "      <td>98.878568</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>16.833620</td>\n",
              "      <td>1.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>10</th>\n",
              "      <td>5179.537200</td>\n",
              "      <td>24.000000</td>\n",
              "      <td>0.291450</td>\n",
              "      <td>0.317743</td>\n",
              "      <td>0.219575</td>\n",
              "      <td>0.524889</td>\n",
              "      <td>0.912080</td>\n",
              "      <td>1.731000</td>\n",
              "      <td>0.294112</td>\n",
              "      <td>6.970000</td>\n",
              "      <td>...</td>\n",
              "      <td>18.665421</td>\n",
              "      <td>43.788124</td>\n",
              "      <td>80.623260</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>20.254749</td>\n",
              "      <td>1.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>11</th>\n",
              "      <td>4169.141900</td>\n",
              "      <td>17.700000</td>\n",
              "      <td>0.251182</td>\n",
              "      <td>0.349382</td>\n",
              "      <td>0.318722</td>\n",
              "      <td>1.972222</td>\n",
              "      <td>0.934019</td>\n",
              "      <td>1.326667</td>\n",
              "      <td>0.191778</td>\n",
              "      <td>7.090000</td>\n",
              "      <td>...</td>\n",
              "      <td>20.748655</td>\n",
              "      <td>45.806610</td>\n",
              "      <td>72.343262</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>14.328635</td>\n",
              "      <td>1.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>12</th>\n",
              "      <td>4823.624700</td>\n",
              "      <td>17.570000</td>\n",
              "      <td>0.271564</td>\n",
              "      <td>0.355505</td>\n",
              "      <td>0.287925</td>\n",
              "      <td>1.816667</td>\n",
              "      <td>0.860873</td>\n",
              "      <td>1.394167</td>\n",
              "      <td>0.311451</td>\n",
              "      <td>10.340000</td>\n",
              "      <td>...</td>\n",
              "      <td>17.162003</td>\n",
              "      <td>35.580306</td>\n",
              "      <td>56.156536</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>15.916426</td>\n",
              "      <td>1.0</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>12 rows × 794 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "variable  Adj Close__abs_energy  Adj Close__absolute_sum_of_changes  \\\n",
              "id                                                                    \n",
              "1                   6019.416900                           26.540000   \n",
              "2                   6705.488100                           27.860000   \n",
              "3                   7702.374500                           31.760000   \n",
              "4                   6168.877000                           33.650000   \n",
              "5                   6890.726000                           28.450000   \n",
              "6                   9564.220168                           34.500002   \n",
              "7                  10788.664338                           33.990004   \n",
              "8                  13088.049644                           39.550004   \n",
              "9                   4536.335000                           23.910000   \n",
              "10                  5179.537200                           24.000000   \n",
              "11                  4169.141900                           17.700000   \n",
              "12                  4823.624700                           17.570000   \n",
              "\n",
              "variable  Adj Close__agg_autocorrelation__f_agg_\"mean\"  \\\n",
              "id                                                       \n",
              "1                                             0.354006   \n",
              "2                                             0.275627   \n",
              "3                                             0.370745   \n",
              "4                                             0.310897   \n",
              "5                                             0.467041   \n",
              "6                                             0.489733   \n",
              "7                                             0.475292   \n",
              "8                                             0.470143   \n",
              "9                                             0.204146   \n",
              "10                                            0.291450   \n",
              "11                                            0.251182   \n",
              "12                                            0.271564   \n",
              "\n",
              "variable  Adj Close__agg_autocorrelation__f_agg_\"median\"  \\\n",
              "id                                                         \n",
              "1                                               0.432519   \n",
              "2                                               0.274121   \n",
              "3                                               0.409414   \n",
              "4                                               0.334679   \n",
              "5                                               0.551048   \n",
              "6                                               0.566027   \n",
              "7                                               0.568334   \n",
              "8                                               0.476228   \n",
              "9                                               0.215385   \n",
              "10                                              0.317743   \n",
              "11                                              0.349382   \n",
              "12                                              0.355505   \n",
              "\n",
              "variable  Adj Close__agg_autocorrelation__f_agg_\"var\"  \\\n",
              "id                                                      \n",
              "1                                            0.175319   \n",
              "2                                            0.205653   \n",
              "3                                            0.170077   \n",
              "4                                            0.171170   \n",
              "5                                            0.136986   \n",
              "6                                            0.143772   \n",
              "7                                            0.152314   \n",
              "8                                            0.092382   \n",
              "9                                            0.239502   \n",
              "10                                           0.219575   \n",
              "11                                           0.318722   \n",
              "12                                           0.287925   \n",
              "\n",
              "variable  Adj Close__agg_linear_trend__f_agg_\"max\"__chunk_len_10__attr_\"intercept\"  \\\n",
              "id                                                                                   \n",
              "1                                                  1.730545                          \n",
              "2                                                  1.630727                          \n",
              "3                                                  1.773636                          \n",
              "4                                                  2.242727                          \n",
              "5                                                  1.721364                          \n",
              "6                                                  1.204091                          \n",
              "7                                                  1.007727                          \n",
              "8                                                 -0.120455                          \n",
              "9                                                  1.587333                          \n",
              "10                                                 0.524889                          \n",
              "11                                                 1.972222                          \n",
              "12                                                 1.816667                          \n",
              "\n",
              "variable  Adj Close__agg_linear_trend__f_agg_\"max\"__chunk_len_10__attr_\"rvalue\"  \\\n",
              "id                                                                                \n",
              "1                                                  0.860689                       \n",
              "2                                                  0.823661                       \n",
              "3                                                  0.767598                       \n",
              "4                                                  0.757335                       \n",
              "5                                                  0.853270                       \n",
              "6                                                  0.912175                       \n",
              "7                                                  0.919332                       \n",
              "8                                                  0.934536                       \n",
              "9                                                  0.866586                       \n",
              "10                                                 0.912080                       \n",
              "11                                                 0.934019                       \n",
              "12                                                 0.860873                       \n",
              "\n",
              "variable  Adj Close__agg_linear_trend__f_agg_\"max\"__chunk_len_10__attr_\"slope\"  \\\n",
              "id                                                                               \n",
              "1                                                  1.337879                      \n",
              "2                                                  1.454727                      \n",
              "3                                                  1.246727                      \n",
              "4                                                  1.106545                      \n",
              "5                                                  1.247364                      \n",
              "6                                                  1.584273                      \n",
              "7                                                  1.764636                      \n",
              "8                                                  2.199909                      \n",
              "9                                                  1.467333                      \n",
              "10                                                 1.731000                      \n",
              "11                                                 1.326667                      \n",
              "12                                                 1.394167                      \n",
              "\n",
              "variable  Adj Close__agg_linear_trend__f_agg_\"max\"__chunk_len_10__attr_\"stderr\"  \\\n",
              "id                                                                                \n",
              "1                                                  0.279805                       \n",
              "2                                                  0.354107                       \n",
              "3                                                  0.346998                       \n",
              "4                                                  0.318047                       \n",
              "5                                                  0.254106                       \n",
              "6                                                  0.237248                       \n",
              "7                                                  0.251760                       \n",
              "8                                                  0.279240                       \n",
              "9                                                  0.319369                       \n",
              "10                                                 0.294112                       \n",
              "11                                                 0.191778                       \n",
              "12                                                 0.311451                       \n",
              "\n",
              "variable  Adj Close__agg_linear_trend__f_agg_\"max\"__chunk_len_50__attr_\"intercept\"  \\\n",
              "id                                                                                   \n",
              "1                                                  4.470000                          \n",
              "2                                                  3.720000                          \n",
              "3                                                  6.456667                          \n",
              "4                                                  6.611667                          \n",
              "5                                                  5.736667                          \n",
              "6                                                  6.716667                          \n",
              "7                                                  6.636667                          \n",
              "8                                                  8.030000                          \n",
              "9                                                  7.510000                          \n",
              "10                                                 6.970000                          \n",
              "11                                                 7.090000                          \n",
              "12                                                10.340000                          \n",
              "\n",
              "variable                         ...                          \\\n",
              "id                               ...                           \n",
              "1                                ...                           \n",
              "2                                ...                           \n",
              "3                                ...                           \n",
              "4                                ...                           \n",
              "5                                ...                           \n",
              "6                                ...                           \n",
              "7                                ...                           \n",
              "8                                ...                           \n",
              "9                                ...                           \n",
              "10                               ...                           \n",
              "11                               ...                           \n",
              "12                               ...                           \n",
              "\n",
              "variable  Adj Close__time_reversal_asymmetry_statistic__lag_1  \\\n",
              "id                                                              \n",
              "1                                                 28.749453     \n",
              "2                                                 22.531925     \n",
              "3                                                  6.108310     \n",
              "4                                                 12.330922     \n",
              "5                                                 30.335133     \n",
              "6                                                 42.316454     \n",
              "7                                                 85.408064     \n",
              "8                                                187.013637     \n",
              "9                                                 31.148060     \n",
              "10                                                18.665421     \n",
              "11                                                20.748655     \n",
              "12                                                17.162003     \n",
              "\n",
              "variable  Adj Close__time_reversal_asymmetry_statistic__lag_2  \\\n",
              "id                                                              \n",
              "1                                                 57.362763     \n",
              "2                                                 45.286815     \n",
              "3                                                 14.899758     \n",
              "4                                                 23.026106     \n",
              "5                                                 61.237832     \n",
              "6                                                 86.953030     \n",
              "7                                                170.623756     \n",
              "8                                                315.085442     \n",
              "9                                                 62.606912     \n",
              "10                                                43.788124     \n",
              "11                                                45.806610     \n",
              "12                                                35.580306     \n",
              "\n",
              "variable  Adj Close__time_reversal_asymmetry_statistic__lag_3  \\\n",
              "id                                                              \n",
              "1                                                 83.149545     \n",
              "2                                                 65.917476     \n",
              "3                                                 27.105037     \n",
              "4                                                 32.808871     \n",
              "5                                                 91.868611     \n",
              "6                                                135.130659     \n",
              "7                                                225.458101     \n",
              "8                                                423.155964     \n",
              "9                                                 98.878568     \n",
              "10                                                80.623260     \n",
              "11                                                72.343262     \n",
              "12                                                56.156536     \n",
              "\n",
              "variable  Adj Close__value_count__value_-inf  Adj Close__value_count__value_0  \\\n",
              "id                                                                              \n",
              "1                                        0.0                              0.0   \n",
              "2                                        0.0                              0.0   \n",
              "3                                        0.0                              0.0   \n",
              "4                                        0.0                              0.0   \n",
              "5                                        0.0                              0.0   \n",
              "6                                        0.0                              0.0   \n",
              "7                                        0.0                              0.0   \n",
              "8                                        0.0                              0.0   \n",
              "9                                        0.0                              0.0   \n",
              "10                                       0.0                              0.0   \n",
              "11                                       0.0                              0.0   \n",
              "12                                       0.0                              0.0   \n",
              "\n",
              "variable  Adj Close__value_count__value_1  Adj Close__value_count__value_inf  \\\n",
              "id                                                                             \n",
              "1                                     0.0                                0.0   \n",
              "2                                     0.0                                0.0   \n",
              "3                                     0.0                                0.0   \n",
              "4                                     0.0                                0.0   \n",
              "5                                     0.0                                0.0   \n",
              "6                                     0.0                                0.0   \n",
              "7                                     0.0                                0.0   \n",
              "8                                     0.0                                0.0   \n",
              "9                                     0.0                                0.0   \n",
              "10                                    0.0                                0.0   \n",
              "11                                    0.0                                0.0   \n",
              "12                                    0.0                                0.0   \n",
              "\n",
              "variable  Adj Close__value_count__value_nan  Adj Close__variance  \\\n",
              "id                                                                 \n",
              "1                                       0.0            18.781676   \n",
              "2                                       0.0            24.022986   \n",
              "3                                       0.0            22.682310   \n",
              "4                                       0.0            18.265710   \n",
              "5                                       0.0            17.713980   \n",
              "6                                       0.0            27.107963   \n",
              "7                                       0.0            33.772204   \n",
              "8                                       0.0            41.308127   \n",
              "9                                       0.0            16.833620   \n",
              "10                                      0.0            20.254749   \n",
              "11                                      0.0            14.328635   \n",
              "12                                      0.0            15.916426   \n",
              "\n",
              "variable  Adj Close__variance_larger_than_standard_deviation  \n",
              "id                                                            \n",
              "1                                                       1.0   \n",
              "2                                                       1.0   \n",
              "3                                                       1.0   \n",
              "4                                                       1.0   \n",
              "5                                                       1.0   \n",
              "6                                                       1.0   \n",
              "7                                                       1.0   \n",
              "8                                                       1.0   \n",
              "9                                                       1.0   \n",
              "10                                                      1.0   \n",
              "11                                                      1.0   \n",
              "12                                                      1.0   \n",
              "\n[12 rows x 794 columns]"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 85,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "tsfresh.feature_extraction.feature_calculators.abs_energy(dataset['Adj Close'])"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 86,
          "data": {
            "text/plain": [
              "85643.58435012001"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 86,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "tsfresh.feature_extraction.feature_calculators.absolute_sum_of_changes(dataset['Adj Close'])"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 87,
          "data": {
            "text/plain": [
              "200.18001000000004"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 87,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    }
  ],
  "metadata": {
    "kernel_info": {
      "name": "python3"
    },
    "language_info": {
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "codemirror_mode": {
        "version": 3,
        "name": "ipython"
      },
      "mimetype": "text/x-python",
      "version": "3.5.5",
      "name": "python",
      "file_extension": ".py"
    },
    "kernelspec": {
      "name": "python3",
      "language": "python",
      "display_name": "Python 3"
    },
    "nteract": {
      "version": "0.12.2"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 4
}